<form id="add-form" class="form-horizontal form-error" role="form" data-toggle="validator" method="POST" action="">
    {:token()}
   
    <div class="form-group">
        <label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('规则名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" placeholder="规则名最多60个字" class="form-control" name="row[name]" type="text" value="">
        </div>
        <div style="clear: both;"></div>
    </div>
    <div id="_keywordItem">
        <div class="form-group" style="margin-bottom: 15px;">
            <label for="c-keyword" class="control-label col-xs-12 col-sm-2">{:__('关键词')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-keyword" data-rule="required" placeholder="" class="form-control" name="mate[0][keyword]" type="text" value="">
            </div>
            <a href="javascript:;" class="btn btn-primary keyword-push"><i class="fa fa-plus"></i> </a>
        </div>
        <div style="clear: both;"></div>
    </div>
     <div class="form-group" style="margin-bottom: 15px;">
        <label for="c-keyword" class="control-label col-xs-12 col-sm-2">{:__('回复内容')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p style="padding-top:7px;">
                <input type="radio" name="row[type]" value="text" checked=""> 文字　
                <input type="radio" name="row[type]" value="image"> 图片　
                <input type="radio" name="row[type]" value="mpnews" data-href="{:url('material/item')}"> 图文
            </p>
            <!--文字内容-->
            <div class="_content content-text">
                <textarea id="c-content" class="form-control simple-editor" name="row[content]">{:isset($row['content']) ? $row['content'] : ''}</textarea>
            </div>
            <!--图片内容-->
            <div class="_content content-image" style="display: none">
                <div class="input-group">
                    <input id="c-image" class="form-control" size="35" name="row[image]" type="text" value="{:isset($row['image']) ? $row['image'] : ''}">
                    <input type="hidden" id="_media_id" name="row[media_id]" value="{:isset($row['media_id']) ? $row['media_id'] : ''}" >
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/jpeg,image/png,image/jpg,image/bmp" data-url="{:url('ajax/wxupload')}" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                    </div>
                    <span class="msg-box n-right"></span>
                </div>
                <ul class="row list-inline faupload-preview" id="p-image"></ul>
            </div>
            <!--图文内容-->
            <div class="_content content-material" style="display: none">
            </div>
        </div>
        <div style="clear: both;"></div>
    </div>
    <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2" > {:__('同步至')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <select class="form-control selectpicker" multiple="true" name="wechat[]">
                    <?php foreach($wechats as $id=>$wxname):?>
                        <?php if($id != $curr_wechat_id):?>
                        <option value="{$id}">{$wxname}</option>
                        <?php endif;?>
                    <?php endforeach;?>
                    </select>
                </div>
            </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-10 text-right">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>

    </div>
</form>
<script type="text/html" id="_keywordTempHtml">
    <div class="form-group" style="margin-bottom: 15px;">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <input placeholder="" class="form-control" name="mate[{_index}][keyword]" type="text" value="">
        </div>
        <a href="javascript:;" class="btn btn-danger keyword-remove"><i class="fa fa-minus"></i> </a>
    </div>
</script>
